package com.happyhome.datamodel;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the customer database table.
 * 
 */
@Entity
@Table(name="CUSTOMER")
public class Customer implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long idCustomer;
	private Date birthday;
	private String email;
	private String fullName;
	private String identifierPassport;
	private String mobile;
	private String note;
	private Boolean status;
	private Province province;
	private Set<RoomRental> roomRentals = new HashSet<RoomRental>();
	private Set<Image> images = new HashSet<Image>();
	public Customer() {
	}
	
	@Id
	@Column(name="ID_CUSTOMER")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getIdCustomer() {
		return this.idCustomer;
	}

	public void setIdCustomer(Long idCustomer) {
		this.idCustomer = idCustomer;
	}


	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="BIRTHDAY")
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name="EMAIL")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}


	@Column(name="FULL_NAME")
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}


	@Column(name="IDENTIFIER_PASSPORT")
	public String getIdentifierPassport() {
		return this.identifierPassport;
	}

	public void setIdentifierPassport(String identifierPassport) {
		this.identifierPassport = identifierPassport;
	}

	@Column(name="MOBILE")
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name="NOTE")
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Column(name="STATUS")
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}


	//bi-directional many-to-one association to Province
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="HOMETOWN_ID")
	public Province getProvince() {
		return this.province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}


	//bi-directional many-to-one association to RoomRental
	@OneToMany(mappedBy = "customer", fetch = FetchType.LAZY)
	public Set<RoomRental> getRoomRentals() {
		return this.roomRentals;
	}

	public void setRoomRentals(
			Set<RoomRental> roomRentals) {
		this.roomRentals = roomRentals;
	}
	
	//bi-directional many-to-one association to RoomRental
	@OneToMany(mappedBy = "customer", fetch = FetchType.LAZY)
	public Set<Image> getImages() {
		return this.images;
	}

	public void setImages(
			Set<Image> images) {
		this.images = images;
	}
}